package com.hg.miaosha.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.hg.miaosha.entity.Seckill;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * created by skh on 2019/6/15
 */
public interface SeckillDao extends BaseMapper<Seckill> {

	void decreaseStockBySeckillId(@Param("seckillId") Integer seckillId);

    Seckill getGoodsStockBySeckillIdWithPessimisticLock(@Param("seckillId") Integer seckillId);

    Integer updateSeckillNumberBySecKillId(@Param("seckillId") Integer seckillId);

    Integer updateSeckillNumberBySecKillIdWithOptimisticLock(@Param("seckillId") Integer seckillId, @Param("version") Integer version);
}
